package com.lishilin.gulimall.product.feign;

import com.lishilin.common.to.SkuReductionTo;
import com.lishilin.common.to.SpuBoundsTo;
import com.lishilin.common.utils.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.ResponseBody;

@FeignClient("gulimall-coupon") //1申明远程调用的服务的名称2当前服务需要开启远程调用功能  @EnableFeignClients("com.lishilin.gulimall.product.feign")
public interface CouponFeignService {

    //@RequestBody 将spuBoundsTo转换为json发送给gulimall-coupon远程服务的/coupon/spubounds/save接口
    //只要双方的json相互兼容，就可以转化为对方服务所需要的实体类
    @PostMapping("/coupon/spubounds/save")
    R saveSpuBounds(@RequestBody SpuBoundsTo spuBoundsTo);

    @PostMapping("/coupon/skufullreduction/saveInfo")
    R saveSkuReduction(@RequestBody SkuReductionTo skuReductionTo);
}
